from django.db import models


# 分数
class Grade(models.Model):
    client = models.CharField(max_length=24)
    grade = models.IntegerField(default=0)

    class Meta:
        db_table = 'grade'
        verbose_name = '分数登记表'
        verbose_name_plural = verbose_name


# 名次
class Rank(models.Model):
    g_id = models.OneToOneField(Grade, on_delete=models.CASCADE, primary_key=True, )
    rank = models.IntegerField()

    class Meta:
        db_table = 'rank'
